/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 * No deletion without permission, or be held responsible to law.
 * @author XYMTOP
 */
import { defHttp } from '/@/utils/http/axios';
import { useGlobSetting } from '/@/hooks/setting';
import { BasicModel, Page } from '../model/baseModel';

const { adminPath } = useGlobSetting();

export interface TbOrderAttachment extends BasicModel<TbOrderAttachment> {
  attachmentId?: string; // 附件id
  statusId?: string; // 附件所属状态id
  url?: string; // 文件获取地址
  createTime?: string; // 文件创建时间
  updateTime?: string; // 文件最后更新时间
  uploaderId?: string; // 文件上传者用户id
  fileType?: number; // 文件类型（0图片，1文件）
  suffix?: string; // 文件后缀名
  fileName?: string; // 文件名
  comment?: string; // 备注
  deleted?: number; // 逻辑删除（0正常，1删除）
}

export const tbOrderAttachmentList = (params?: TbOrderAttachment | any) =>
  defHttp.get<TbOrderAttachment>({ url: adminPath + '/tb/tbOrderAttachment/list', params });

export const tbOrderAttachmentListData = (params?: TbOrderAttachment | any) =>
  defHttp.post<Page<TbOrderAttachment>>({ url: adminPath + '/orderAttachment/listData', params });

export const tbOrderAttachmentForm = (params?: TbOrderAttachment | any) =>
  defHttp.get<TbOrderAttachment>({ url: adminPath + '/tb/tbOrderAttachment/form', params });

export const tbOrderAttachmentSave = (params?: any, data?: TbOrderAttachment | any) =>
  defHttp.postJson<TbOrderAttachment>({ url: adminPath + '/orderAttachment/save', params, data });

export const tbOrderAttachmentDelete = (params?: TbOrderAttachment | any) =>
  defHttp.get<TbOrderAttachment>({ url: adminPath + '/orderAttachment/delete', params });
